import { url } from "koa-router"

const fn_list = (ctx,next)=>{
    ctx.body = "商品列表"
}


const fn_add = (ctx,next)=>{
    ctx.body = "添加商品"
}


const fn_del = (ctx,next)=>{
    ctx.body = "删除商品"
}

const fn_getById = (ctx,next)=>{
    ctx.body = {
        code:1000,
        msg:"获取成功",

    }
}
const fn_edit = (ctx,next)=>{
    ctx.body = {
        code:1000,
        msg:"编辑成功",
        data:res
    }
    console.log(1);
    
}






export default[

    {
        method:'get',
        url:'/goods',
        fn:fn_list
    },
    {
        method:'add',
        url:'/goods',
        fn:fn_add
    },
    {
        method:'get',
        url:'/goods/:id',
        fn:fn_getById
    },
    {
        method:'delete',
        url:'/goods/:id',
        fn:fn_del
    },
    {
        method:'put',
        url:'/goods/:id',
        fn:fn_edit
    }

]